import {
    x as i,
    r as k,
    i as o,
    Q as h,
    o as c,
    a as U,
    w as z,
    k as q,
    l as t,
    m as l,
    e as _,
    P as u,
    O as p
} from "./index-abba05ce.js";

const B = {class: "storage"}, A = {
    __name: "index", setup(C) {
        const m = i(!0), e = i({type: 0, name: "", mobile: "", adds: ""}), f = k({
            name: [{required: !0, message: "请填写一个收货名称！", trigger: "blur"}],
            mobile: [{required: !0, message: "请填写一个收货电话！", trigger: "blur"}],
            adds: [{required: !0, message: "请填写一个收货地址！", trigger: "blur"}]
        }), g = async () => {
            await u.confirm("确定要保存吗？"), e.value.type = 1;
            const a = await p.order.refundAdds(e.value);
            a.error ? u.msgError(a.msg) : u.msgSuccess(a.msg)
        };
        return (async () => {
            const a = await p.order.refundAdds(e.value);
            a.data && (e.value.name = a.data[0], e.value.mobile = a.data[1], e.value.adds = a.data[2]), m.value = !1
        })(), (a, s) => {
            const v = o("el-text"), b = o("el-button"), n = o("el-form-item"), x = o("el-row"), d = o("el-input"),
                w = o("el-form"), V = o("el-card"), y = h("loading");
            return c(), U("div", B, [z((c(), q(V, {class: "border-none", shadow: "never"}, {
                default: t(() => [l(w, {
                    ref: "formRef",
                    model: e.value,
                    "label-width": "84px",
                    rules: f
                }, {
                    default: t(() => [l(x, {
                        class: "mb-4",
                        justify: "space-between"
                    }, {
                        default: t(() => [l(v, {
                            class: "mx-1",
                            tag: "b"
                        }, {
                            default: t(() => [_(" 注：用于用户售后退货地址 ")]),
                            _: 1
                        }), l(n, null, {
                            default: t(() => [l(b, {
                                size: "large",
                                type: "primary",
                                icon: "Select",
                                onClick: g
                            }, {default: t(() => [_("保存")]), _: 1})]), _: 1
                        })]), _: 1
                    }), l(n, {label: "收货人", class: "flex-1", prop: "name"}, {
                        default: t(() => [l(d, {
                            size: "large",
                            modelValue: e.value.name,
                            "onUpdate:modelValue": s[0] || (s[0] = r => e.value.name = r),
                            placeholder: "请填写"
                        }, null, 8, ["modelValue"])]), _: 1
                    }), l(n, {
                        label: "收货电话",
                        class: "flex-1",
                        prop: "mobile"
                    }, {
                        default: t(() => [l(d, {
                            size: "large",
                            modelValue: e.value.mobile,
                            "onUpdate:modelValue": s[1] || (s[1] = r => e.value.mobile = r),
                            placeholder: "请填写"
                        }, null, 8, ["modelValue"])]), _: 1
                    }), l(n, {label: "收货地址", class: "flex-1", prop: "adds"}, {
                        default: t(() => [l(d, {
                            size: "large",
                            type: "textarea",
                            modelValue: e.value.adds,
                            "onUpdate:modelValue": s[2] || (s[2] = r => e.value.adds = r),
                            maxlength: "100",
                            placeholder: "请填写",
                            "show-word-limit": ""
                        }, null, 8, ["modelValue"])]), _: 1
                    })]), _: 1
                }, 8, ["model", "rules"])]), _: 1
            })), [[y, m.value]])])
        }
    }
};
export {A as default};
